package com.disease.api.service.config;

import com.sgw.license.LicenseCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JwtInterceptor())
                .addPathPatterns("/disease/v1/api/**","/test") // 拦截disease所有请求
                .excludePathPatterns("/disease/v1/api/user/login","/disease/v1/api/user/isInputLicenseCode"); // 排除登录接口

        registry.addInterceptor(new LicenseCheckInterceptor()).addPathPatterns("/disease/v1/api/user/login");
    }
}
